home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5539 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  48 lines

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Error: FILE *rl_instream = stdin; initializer is not a constant
  5. Date: 08 Feb 1996 23:50:37 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Feb8165037@qcd.lanl.gov>
  8. References: <4fbenh$60s@news1.sympatico.ca>
  9. NNTP-Posting-Host: qcd.lanl.gov
  10. Mime-Version: 1.0
  11. Content-Type: text
  12. In-reply-to: Stephane Lajeunesse's message of 8 Feb 1996 00:05:05 GMT
  13.  
  14. In article <4fbenh$60s@news1.sympatico.ca> Stephane Lajeunesse
  15. <slajeunesse@sympatico.ca> writes: 
  16. <snip>
  17.    When I'm comiling this using GCC 2.5.8 on Xenix, this type of 
  18.    initialization doesn't work:
  19.  
  20.    FILE *rl_inputstream = stdin;
  21.  
  22.    It halts with a message :
  23.  
  24.    initializer is not a constant
  25.  
  26.    Any ideas on how I can work around this problem.
  27.  
  28. Program in C? :-)
  29.  
  30. Seriously, what do you mean by `work around the problem'. An
  31. implementation is allowed to delay deciding what stdin at least till
  32. your program starts. If you use it for an initializer for a variable
  33. which becomes defined only within some block (e.g. main), you should
  34. be fine. 
  35.  
  36. (You still cannot use it to initialize an element of an array or
  37. struct etc.)
  38.  
  39. Cheers
  40. Tanmoy
  41. --
  42. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  43. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  44. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  45. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  46. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  47. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  48.